package com.yf1706.dao.jpa;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.yf1706.bean.FunctionType;

public interface IFunctionTypeJDAO extends CrudRepository<FunctionType, Integer>{
	//通过角色ID  和 权限类型  查询权限选中情况
	@Query(nativeQuery = true, value = "select fun_id,ft_id,fun_name,(select count(*)  from role_function fr where role_id=?1 and fr.fun_id=f.fun_id) owner from function f where ft_id=?2")
	public List<Object[]> findFunctionsByRoleId(int roleId, int typeId);
}
